<template>
  <eui-background type="common">
    <eui-navbar ref="RdsNavBar" :title="title" status-bar="true" :closeCallback="closeCallback"
    :storeName="getRelatedName('rdsStores', mainDataModel.c_store_id)"
    :storeId="mainDataModel.c_store_id" @onClickStore="clickStore">
    </eui-navbar>
    <view class="search_view" v-if="isEditOnly" >
      <eui-search-bar
          v-model="searchText"
          :focus="true"
          style="flex: 1 0 0"
          ref="RdsSearchBar"
          placeholder="请扫商品编码/条码"
          @confirm="searchConfirm"
          :show-filter-icon="false"
          leftIcon="icon-saoyisao"
          @leftIconClick="()=>clickScanRight('defaultBarcode')"
          radius="30"
      />
    </view>
    <!-- MARK: 单头展示(只读展示) -->
    <view class="count_input_view" v-if="!isEditOnly">
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="origData.main.c_store_id" :name="getRelatedName('rdsStores', origData.main.c_store_id)" title="机构" type="titlename2" />
        <eui-text style="flex-grow:2;" :value="origData.main.c_print_n" title="打印次数" type="name2" />
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="origData.main.c_mk_userno" :name="getRelatedName('rdsUsers', origData.main.c_mk_userno)" title="申请人" type="titlename2" />
        <eui-text style="flex-grow:2;" :value="origData.main.c_mk_dt" type="name2" />
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="origData.main.c_print_userno" :name="getRelatedName('rdsUsers', origData.main.c_print_userno)" title="打印人" type="titlename2" />
        <eui-text style="flex-grow:2;" :value="origData.main.c_print_dt"  type="name2" />
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:2;" :value="origData.main.c_note" title="备注" type="name2"
        />
      </view>
    </view>
    <!-- MARK: 可编辑商品打印数量 -->
    <view class="count_input_view" v-if="isEditOnly">
      <view class="count_input_column column_title">
        <eui-card-input :value="currentGdsCodeWithName" type="text" :titleWidth="0" placeholder="" displayable/>
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="currentGds.c_barcode" title="条码" type="name2" placeholder="" />
        <eui-text
            style="flex-grow:1;"
            v-model="currentGds.c_apply_n"
            ref="gdsNumInput"
            type="number2"
            title="打印数量"
            maxlength="3"
        />
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="currentGds.c_model	" title="规格" type="name2" />
        <eui-text style="flex-grow:1;" :value="currentGds.c_price" title="价格" type="price2" :precision="2" />
      </view>
      <view class="count_input_column count_input_num">
        <eui-text style="flex-grow:1;" :value="currentGdsUnit" title="包装" type="name2" placeholder="" />
        <eui-text style="flex-grow:1;" :value="currentGds.c_prom_price" title="促销价" type="price2" :precision="2" />
      </view>
    </view>
    <!-- MARK: 商品明细展示 -->
    <view class="virtual_head" v-if="isEditOnly">
      <text class="cell_color_code" style="flex: 0 0 10%">序号</text>
      <text class="cell_color_code" style="flex: 0 0 50%">商品(编码/条码)</text>
      <text class="cell_color_code" style="flex: 0 0 20%">打印数量</text>
      <text class="cell_color_code cell_color_num flex_w_auto">操作</text>
    </view>
    <view class="virtual_head" v-else>
      <text class="cell_color_code" style="flex: 0 0 10%">序号</text>
      <text class="cell_color_code" style="flex: 0 0 50%">商品(编码/条码)</text>
      <text class="cell_color_code cell_color_num flex_w_auto">打印数量</text>
    </view>
    <view class="footer-view" :style="{ height: listHeight + 'rpx' }" v-if="isEditOnly">
      <eui-virtual-list :showIndex="true" type="list2" :origList="dataList" >
        <template v-slot:list="scope,index">
          <view class="list_cell_item cell_color_code" style="flex: 0 0 10%">{{ scope.c_shelf_no }}</view>
          <view class="list_cell_item" style="flex: 0 0 50%">
            <view>{{ scope.c_gname }}</view>
            <view class="cell_color_code">{{ scope.c_gcode }}/{{ scope.c_barcode }}</view>
          </view>
          <view class="list_cell_item cell_color_num" style="flex: 0 0 20%">{{ scope.c_apply_n }}</view>
          <view class="list_cell_item flex_w_auto">
            <eui-tag text="删除" type="error" @click="() => bindClick(scope)" />
          </view>
        </template>
      </eui-virtual-list>
    </view>
    <view class="footer-view" :style="{ height: listHeight + 'rpx' }" v-else>
      <eui-virtual-list :showIndex="true" type="list2" :origList="dataList" >
        <template v-slot:list="scope,index">
          <view class="list_cell_item cell_color_code" style="flex: 0 0 10%">{{ scope.c_shelf_no }}</view>
          <view class="list_cell_item" style="flex: 0 0 50%">
            <view>{{ scope.c_gname }}</view>
            <view class="cell_color_code">{{ scope.c_gcode }}/{{ scope.c_barcode }}</view>
          </view>
          <view class="list_cell_item cell_color_num flex_w_auto">{{ scope.c_apply_n }}</view>
        </template>
      </eui-virtual-list>
    </view>
    <view class="virtual_footer">
      <text class="cell_color_code" style="flex: 0 0 50%">总计 {{ total_line }} 行</text>
      <text class="cell_color_code cell_color_num flex_w_auto">数量总计：{{ total_num }}</text>
    </view>
    <!-- MARK: 底部按钮 -->
    <view class="bottom-view" v-if="origData.main.c_status == '0'" >
      <view class="center-style">
        <eui-button
            type="max"
            singleTag="audit"
            title="审核"
            @buttonClick="buttonClick"
            :disabled="!(dataList.length > 0)"
        />
      </view>
    </view>
  </eui-background>
</template>

<script setup type="ts">
import Enjoy from '@/common/enjoy';
import service from '@/common/service';
import { getRdsUrl, rdsRequest } from '@/hooks/rdsServices';
import { onLoad } from '@dcloudio/uni-app';
import { computed, onMounted, ref } from 'vue';
import dateRangUtil from '../../../common/dateRangUtil';
import { formatNow } from '../../../hooks/useUtils';
import { useMainStore } from '../../../store/modules/store';
import { useLoginStore } from '../../../store/modules/useLoginStore';
import useSaveBill from '@/hooks/useSaveBill';
import {getDictList, getRelatedName} from '../components/RelatedName';
const mainStore = useMainStore();
const LoginStore = useLoginStore();
const rdsUrl = getRdsUrl();
const {loginInfo} = mainStore;
const {sUser} = loginInfo;
const c_id = ref(''); // 标题栏显示单号
const c_store_id = ref(''); //

const dataList = ref([]); // 当前录入的商品列表
const c_id_ref = ref('');
// 主+明细
const origData = ref({
  main: {},
  details: [],
});

// 录入单主+明细
const inputData = ref({
  main: {},
  details: [],
});

// 系统参数，字典
const sysConfig = ref({
  c_status: {},     // 单据状态
});

// 重量单位范围：用于验证商品数量是否可以录入小数
const weightUnits = ref([]);

// 当前扫描到的商品
const currentGds = ref({
  c_gname: '', // c_name
  c_gcode: '', // 商品编码
  c_price: '', // 售价
  c_prom_price: '', // 促销价
  c_barcode: '',
  c_model:'', // 规格
  c_basic_unit: '', // 单位
  c_n: '', // 箱码含量
  c_apply_n: '', // 申请打印数量
  c_sort: '', // 顺序号
});

// 当前扫描到的商品存在于哪个列表
const currentGdsPosition = ref(-1);
//
const searchText = ref('');

// 当前录入单最大序号
const gsort = ref(0);

// 多条码商品列表（区分不同的包装含量）
const barcodeList = ref([]);

// 其他变量
const mySortMin = ref(0);
const mySortMax = ref(0);
const myInputSort = ref([]);
const btnSaveEnabled = ref(true);

// 聚焦
const gdsUnitInput = ref(null);
const RdsSearchBar = ref(null);
const gdsNumInput = ref(null);

const listHeight = ref(300)


// 单据-主表
const mainDataModel = ref(
    {
      c_tenant_id: '',
      c_id: '',
      c_bill_type: 'BN1',
      c_status: '0',
      c_store_id: '',
      c_adno: '',
      c_mk_dt: formatNow('YYYY-MM-DD HH:mm:ss'),
      c_mk_userno: loginInfo.sUser,
      c_approve_status: '',
      c_approve_dt: undefined,
      c_au_dt: undefined,
      c_au_userno: '',
      c_print_n: undefined,
      c_print_dt: undefined,
      c_print_userno: '',
      c_note: '',
      c_label_style: '',
      c_label_dt: undefined
    }
);
// 单据明细模型
const detailsDataModel = ref([{
  NewList: [],
  ModifiedList: [],
  DelList: []
}]);
const newList = ref([])
const modifiedList = ref([])
const delList = ref([])

// 计算属性
const title = computed(()=> origData.value.main.c_id || '')

// 是否新增单据，保存是自动创建BillID
const isAdd = ref(true)

const isEditOnly = computed(()=> origData.value.main.c_status == undefined || origData.value.main.c_status === '0');

const currentGdsCode = computed(() =>
    currentGds.value.c_gcode !== '' ? `${currentGds.value.c_gcode || ''}/${currentGds.value.c_barcode || ''}` : '',
);

const currentGdsCodeWithName = computed(() =>
    currentGds.value.c_gcode !== '' ? `[${currentGds.value.c_gcode || ''}]${currentGds.value.c_gname || ''}` : '',
)

const currentGdsUnit = computed(() =>
    currentGds.value.c_gcode !== '' ? `${currentGds.value.c_n|| ''}${currentGds.value.c_basic_unit || ''}` : '',
);

const total_line = computed(() => dataList.value.length );

const total_num = computed(() => dataList.value.reduce((sum, item) => sum + Number(item.c_apply_n), 0));

// MARK: - 生命周期钩子
onLoad(async ({storeId, pid }) => {
  service.enjoyShowLoading('正在加载...');
  await getSysConfig();
  if (pid) {
    await getData(pid);
  }
  if (storeId) {
    mainDataModel.value.c_store_id = storeId
  }
  service.enjoyHideLoading();
});

onMounted(() => {
  getListHeight();
});

// MARK: - 方法定义
// MARK: - 创建单据
const uniqueKey = '商品价签打印申请单';

const { save } = useSaveBill({
  prefix: 'bcApi', // rdsUrl.bcApi
  table: {
    main: [
      {
        tableName: "tb_mo_gds_label_apply",
        primaryKeys: ["c_tenant_id", "c_id"],
      },
    ],
    detail: [
      { tableName: 'tb_mo_gds_label_apply_g', primaryKeys: ['c_tenant_id', 'c_id', 'c_sort'] },
    ]
  },
  uniqueKey: uniqueKey,
  method: "EnjoyBillSaveNew",
  billName: '商品价签打印申请单',
  billType: 'BN1'
});

// 获取列表高度
const getListHeight = async () => {
  await uni.getSystemInfo({
    success: function (res) { // res - 各种参数
      let info = uni.createSelectorQuery().select(".footer-view");
      info.boundingClientRect(function (data) { //data - 各种参数
        //获取列表高度
        let height = res.windowHeight - data.top;
        //转换rpx
        listHeight.value = height / (res.windowWidth / 750) - 200;
      }).exec()
    }
  });
};
// MARK: - 扫描条形码
const openBarcode = (name) => {
  uni.scanCode({
    success: function (res) {
      if (res.result) {
        // 处理扫描结果，例如：
        // currentGds.value[name] = res.result;
        // GetOutLoadDetail();
      }
    },
  });
};

// 数量输入框确认后控制聚焦
const inputNumConfirm = () => {
  const {_key} = currentGds.value;
  // 更新到保存列表
  // dataList.value.splice(_key, 1, {
  //   ...currentGds.value,
  // });

  // 控制聚焦
  setTimeout(() => {
    RdsSearchBar?.value?.clearAndFocus();
  }, 100);
};

// 输入检查
const checkInputNum = (val, prop) => {
  const {c_apply_n} = currentGds.value;
  let _val = Number(val) || 0;
  // 重置数据
  currentGds.value = {
    ...currentGds.value,
    [prop]: _val,
  };
};

// 页面回调方法
const searchConfirm = async (code) => {
  let e = code.value;
  if (e === '') {
    RdsSearchBar.value.clearAndFocus();
    return;
  }
  searchText.value = e;

  let samegdsIndex = await searchFromOrigData(e);
  // 不存在的商品
  if (samegdsIndex == -2) {
    // 控制光标跳转
    setTimeout(() => {
      RdsSearchBar?.value?.clearAndFocus();
    }, 100);
    return false;
  }
  // 已录入的商品
  if (samegdsIndex > -1) {
    currentGds.value = {
      ...dataList.value[samegdsIndex],
      c_apply_n: dataList.value[samegdsIndex].c_apply_n+1
    }
  }
  // 新增的商品
  if (samegdsIndex == -1) {
    currentGds.value = {
      ...newList.value[0],
      c_sort: dataList.value.length+1,
    }
  }
  // 自动保存
  uni.showLoading({ title: "正在保存...", mask: true })
  const gds = {
    ...currentGds.value,
    c_id: origData.value.main.c_id || '',
    c_basic_unit: undefined,
    c_gname: undefined,
    c_model: undefined,
    c_n: undefined,
    c_price: undefined,
  }
  if (samegdsIndex == -1) {
    detailsDataModel.value[0].NewList = [gds]
  }
  if (samegdsIndex > -1) {
    detailsDataModel.value[0].ModifiedList = [gds]
  }
  const result = await save(isAdd.value, mainDataModel.value, detailsDataModel.value)
  uni.hideLoading();
  if (result) {
    uni.showToast({
      duration: 1000,
      icon: 'none',
      title: '保存成功',
      mask: true,
    });
    getData(result.BillId)
  }

  // 控制光标跳转
  setTimeout(() => {
    RdsSearchBar?.value?.clearAndFocus();
  }, 100);
}

// MARK: - 扫商品编码或条码
const searchFromOrigData = async (e) => {
  if (!e) {
    return -2;
  }
  // 定义索引数组
  // const allIndexes = [];
  //
  // // 1. 在列表数据中查找
  // dataList.value.some((item, index) => {
  //   if ( item.c_gcode === e || item.c_barcode === e)  {
  //     allIndexes.push(index);
  //     return true;
  //   }
  // });
  // if (allIndexes.length > 0) {
  //   return allIndexes[0];
  // }

  // 如果列表数据不存在，调用服务验证商品是否存在
  if (e) {
    // 调用 validateGds 验证商品
    let args = {
      billId: '',
      billType: '',
      gcode: e,
      changeDa: dateRangUtil.formatDate('', 'YYYY-MM-DD'),
      storeId: mainDataModel.value.c_store_id,
      queryCode: 'repair',
      invOver: "0"
    };
    service.enjoyShowLoading('正在加载...');
    const result = await rdsRequest(rdsUrl.bcApi, '商品价签打印', 'QueryPrintGdsInfo', args);
    service.enjoyHideLoading();
    if (result.length > 0) {
      const addData = []
      result.forEach(item => {
        addData.push({
          c_gname: item.c_name, // c_name
          c_gcode: item.c_gcode, // 商品编码
          c_price: item.c_price,
          c_prom_price: item.c_prom_price,
          c_barcode: item.c_barcode,
          c_model:item.c_model, // 规格
          c_basic_unit: item.c_basic_unit, // 单位
          c_n:item.c_n, // 箱码含量
          c_apply_n: 1, // 申请打印数量
        })
      })
      newList.value = addData
      return -1;
    } else {
      uni.showToast({
        duration: 1000,
        icon: 'none',
        title: `无此[${e}]商品信息,请重新输入`,
        mask: true,
      });
      return -2;
    }
  }

  uni.showToast({
    duration: 3500,
    icon: 'none',
    title: `【${e}】不在价签打印申请范围！`,
    mask: true,
    complete: () => {
      currentGdsPosition.value = -1;
      onfocusGds();
    },
  });
  return -2;
};

// 获取系统配置
const getSysConfig = async () => {
  const c_status_list = await getDictList('单据状态');
  c_status_list.forEach((e) => {
    sysConfig.value.c_status[e.c_id] = e.c_name;
  });
};

// 选择框点击事件
const clickStore = () => {
  if(mainDataModel.value.c_id) {
    uni.showToast({
				duration: 300,
				icon: 'none',
				title: '单号已生成不允许切换'
			});
    return false;
  }
  let parms = Enjoy.GetDialogParms();
  parms.CallBack = SelectionChanged;
  parms.SelectionType = '机构选择';
  parms.SelectedItems = mainDataModel.value.c_store_id;
  Enjoy.OpenDialog(parms);
};

// 回调方法：切换机构/或其他条件
const SelectionChanged = async (event) => {
  if (event.SelectionType == '机构选择') {
    // 更新机构信息
    mainDataModel.value.c_store_id = event.BackParms.Key;
  }
};

const getData = async (c_id) => {
  // 根据单据id获取单据明细
  const objectData = {
    BillId: c_id,
  };
  const result = await rdsRequest(rdsUrl.bcApi, uniqueKey, 'EnjoyBillQuery', objectData);
  origData.value.main = result.ds[0];
  origData.value.details = result.ds1;
  mainDataModel.value = result.ds[0]
  dataList.value = result.ds1;
  isAdd.value = false;
  detailsDataModel.value = [{
    NewList: [],
    ModifiedList: [],
    DelList: []
  }];
};

const clickScanRight = (type) => {
  uni.scanCode({
    success: (res) => {
      if (res.result) {}
        if (type === 'defaultBarcode') {
          searchText.value = res.result;
          searchConfirm({'value': res.result});
        }
      }
  });
};

const buttonClick = async(t) => {
  let { singleTag } = t;
  switch (singleTag) {
    case 'audit':
      // 审核
      uni.showLoading({ title: "正在审核...", mask: true })
      const objectData = {
        BillId: origData.value.main.c_id,
        UserNo: loginInfo.sUser,
      }
      const result = await rdsRequest(rdsUrl.bcApi, '商品价签打印申请单', 'EnjoyBillAudit', objectData, 'BN1');
      uni.hideLoading();
      if (result == null) {
        uni.showToast({
          duration: 1000,
          icon: 'none',
          title: '审核成功',
          mask: true,
        });
        getData(origData.value.main.c_id)
      }
      break;;
    default:
      break;
  }
};

const closeCallback = () => {
  onfocusGds();
};

const onfocusGds = () => {
  // 控制光标跳转
  setTimeout(() => {
    RdsSearchBar.value.clearAndFocus();
  }, 100);
};

const resetGds = () => {
  currentGds.value = {
    c_gcode: '',
    c_gname: '',
    c_pack: '',
    c_unit: '',
    c_n_pack: '',
    c_n_odd: '',
    c_n: '',
  };
};

// MARK: - 删除商品
const bindClick = (selectGds) => {
  // currentGds.value = origData.value.details[index];
  uni.showModal({
    title: ' 提示',
    content: '您确定要删除数据吗？',
    showCancel: true,
    success: async (res) => {
      if (res.confirm) {
        // 自动保存
        uni.showLoading({ title: "正在删除...", mask: true })
        const gds = {
          ...selectGds,
          c_basic_unit: undefined,
          c_gname: undefined,
          c_model: undefined,
          c_n: undefined,
          c_price: undefined,
        }
        detailsDataModel.value[0].DelList = [gds]
        const result = await save(isAdd.value, mainDataModel.value, detailsDataModel.value)
        uni.hideLoading();
        if (result) {
          uni.showToast({
            duration: 1000,
            icon: 'none',
            title: '删除成功',
            mask: true,
          });
          getData(result.BillId)
          currentGds.value = {
            c_gcode: ''
          }
        }
        // 控制光标跳转
        setTimeout(() => {
          RdsSearchBar?.value?.clearAndFocus();
        }, 100);
      }
    }
  });
}

</script>

<style lang="scss" scoped>
@import '../../../main.scss';

.navigation {
  display: flex;
  height: 100vh;
  width: 100%;
  flex-direction: column;
  background: #F2F2F2;
}

.virtual_head,
.virtual_footer {
  display: flex;
  padding: 5px;
  margin: 0;
  background: #ffffff; //  #e9f7ff

  * {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 2px;
    color: #505050 !important;
  }
}

.virtual_head {
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  // border-bottom: 1px solid #ffffff;
}

.virtual_footer {
  justify-content: space-between;
  border-bottom: 1px solid #e5e5e5;
  border-top: 1px solid #e5e5e5;
  // border-top: 1px solid #ffffff;
}

.footer-view {
  width: 100%;
  flex: 1;
  ::v-deep .list_cell2 {
    margin: 0;
  }
}

.list_view {
  flex: 1;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}

.bottom-view {
  width: 100%;
  height: 100rpx;
  background: #FFFFFF;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-direction: row;
}
.center-style {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  margin-right: 20rpx;
}
.gap-view {
  width: 20rpx;
  height: auto;
}

// 列表展示项自定义样式
.rds-count-input-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  background-color: #ffffff;
  //padding: $uni-spacing-row-base;
  //margin: $uni-spacing-row-base;
  margin: 0 20rpx 1rpx 20rpx;
  padding: 10rpx;
}

.rds-count-input-content:last-child {
  margin-bottom: 180rpx; // 保持和底部一定的距离
}

// 当前扫描到的商品
.with-current-gds {
  background-color: #fdffc2e0;
}

.input-item-index {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2em 0 0;

  ::v-deep .m-text-id {
    color: #3a8ee6;
    font-size: 0.6em !important;
  }
}

.input-item-gdsinfo {
  display: flex;
  flex-direction: column;
  flex: 3;

  ::v-deep .m-text-title,
  ::v-deep .m-text-view {
    width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.input-item-num {
  display: flex;
  justify-content: flex-start;
  flex: 2;
  flex-direction: column;

  * {
    margin: 0;
    padding: 0;
  }
}

// start 自定义更多按钮
.custom-box {
  display: flex;
  flex-direction: column;
}

.custom-menu {
  border-top: 0.03125rem solid #EEEEEE;
  display: flex;
  flex: 1 0 auto;
  width: 100%;
  //justify-content: flex-start;

  * {
    white-space: normal;
  }

  ::v-deep .m-card-input-content {
    display: block;
  }
}

::v-deep .m-card-input-view {
  border-bottom: none;
}

::v-deep .m-input-input {
  //border-bottom: 1px solid #cccccc;
  text-align: left !important;
}

//.setting-item {
//  display: inline-block;
//  align-items: center;
//  font-size: 0.8em;
//  margin: 0.5em;
//  padding: 0.5em;
//}
.setting-item {
  ::v-deep .m-card-input-view {
    display: inline-block;
    width: auto;
    padding-top: 0 !important;
  }
}

// #end 自定义更多按钮

.search_view {
  justify-content: space-between;
  display: flex;

  ::v-deep .main-seach-body {
    padding: 0;
  }
}

.count_input_view {
  margin: 0 12rpx 10rpx;
  background-color: #FFFFFF;
  border-radius: 20rpx;
  position: relative;
  padding:5rpx;

  .count_input_column {
    padding: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .column_title {
    ::v-deep .m-input-input {
      font-size: 1rem;
      font-weight: bold;
      line-height: 1.5rem;
    }
  }

  .count_input_num {
    display: flex;

    ::v-deep .m-title-text {
      display: inline-block;
      min-width: 2rem;
    }
    ::v-deep .m-input-input {

    }
  }

  ::v-deep .uni-input-input {
    background:#F3F3F3;
  }

  ::v-deep .uni-input-input:disabled {
    background:#ccccc;
  }

  ::v-deep .m-card-input-view {
    align-items: stretch;
    align-items: center;
    height: 1rem;
    line-height: 1rem;
    background: none;
  }

  ::v-deep .m-card-input-title {
    // display: none;
    width: auto !important;

    span {
    }
  }

  ::v-deep .m-card-input-content {
    //width: 100%;
    //flex: 1;
    height: auto;
  }

  ::v-deep .m-card-input-right {
    display: none;
  }

  ::v-deep input {
    width: auto;
  }
  ::v-deep .item-detail-view {
    width: 50%;
  }
  ::v-deep .item-text-detail {
    text-align: right;
  }
  ::v-deep .m-card-input-view {
    height: auto!important;
    padding: 0.2rem!important;
  }
}

.list_cell_item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  align-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  * {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.cell_color_code {
  text-align: left;
  color: #505050;
  font-size: 0.8rem;
}

.cell_color_id {
  padding-left: 0.4rem;
  text-align: left;
  font-size: 0.8rem;
  color: #3a8ee6;
}

.cell_color_num {
  padding-right: 1rem;
  text-align: right;
  color: #e64b3a;
}

.flex_w_auto {
  flex: 1 0 auto;
  flex-direction: inherit;
  justify-content: end;
  // background: rgba(110, 180, 40, 1);
}
// ::v-deep .item-detail-view {
//   width:auto;
// }
::v-deep .list_cell_even {
  /* 为偶数行设置样式 */
  background: #f2f2f2;
}

::v-deep .list_cell_odd {
  /* 为奇数行设置样式 */
  background: #ffffff;
}
::v-deep .u-tag {
  margin-right: 0;
}
</style>
